<?php
$moonth= array(
'January' => '一月份',
'February' => '二月份',
'March' => '三月份',
'April' => '四月份',
'May' => '五月份',
'June' => '六月份',
'July' => '七月份',
'August' => '八月份',
'September' => '九月份',
'October' =>'十月份',
'November' => '十一月份',
'December' => '十二月份'
);
?>
<?php echo($html->css('addform2',null,null,false))  ?>
<div id='frm-content'>
<div class='mockDiv'>
<span class='error-message'>
<?php
    if($form->isFieldError('Ad.title'))
        e('标题长度只能在2~100间');
    else if($form->isFieldError('Ad.content'))
        e('广告代码不能为空');
    else if($form->isFieldError('Ad.connectMsg'))
        e('联系方式内容长度要在240字符以下(1个汉字算两个字符)');
    else if($form->isFieldError('Ad.place'))
        e('广告位置编码必须为整数');
?>
</span>
</div>
<?php
e($form->create('Ad',array('action'=>'add')));
e($form->input('Ad.title',array('label' => '广告标题','error'=>false)));
e($form->input('Ad.content',array('label'=>'广告代码','type'=>'textarea','error'=>false)));
e($form->input('Ad.place',array('label'=>'位置编码','type'=>'text','error'=>false)));
e($form->input('Ad.connectMsg',array('label'=>'广告主联系方式','type'=>'textarea','rows'=>3,'error'=>false)));
$datestr = $form->input('Ad.startTime',array('label' => '开始时间','type'=>'date','minYear' => '2009' ,'maxYear' => '2015',
'dateFormat' =>'YMD'));
foreach($moonth as $enm=>$cnm){
    $datestr = str_replace($enm,$cnm,$datestr);
}
e($datestr);
$datestr=$form->input('Ad.endTime',array('label' => '结束时间','type'=>'date','minYear'=>'2009','maxYear'=>'2015','dateFormat'=>'YMD'));
foreach($moonth as $enm=>$cnm){
    $datestr = str_replace($enm,$cnm,$datestr);
}
e($datestr);
e($form->end('提交'));
?>
</div>